<?php 
include_once('connection/connection.php');
include('header.php');
include('menu.php');
include('config.php');
$distId=$_SESSION['dist_id'];
$sql="SELECT distinct district_name FROM `tbl_lookup_location` WHERE district_id=$distId";
$query=mysql_query($sql);
$data=mysql_fetch_array($query);
	
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="css/style_question.css" type="text/css" rel="stylesheet" />
<!--<script language="javascript" type="text/javascript" src="js/validate.js"></script>-->
<!--<script language="Javascript" type="text/javascript" src="q3_ajax_report.js"></script>-->
<!--<script language="javascript" type="text/javascript">
function validate()
{
	valid = true;
	if (document.view_main_q1.district.selectedIndex == 0)
    {
        alert ( "Please select District Name" );
        valid = false;
    }
	if (document.view_main_q1.form_id.selectedIndex == 0)
    {
        alert ( "Please select Form Id" );
        valid = false;
    }
	return valid;
}	
</script>-->
<title>Download Questionnaire3 Tables,KML File for GIS</title>
</head>
<body>
<div align="center">
<form action="" method="post" enctype="multipart/form-data" onSubmit="return validate()" name="view_main_q1">
	<table border="0" width="746" id="table1" cellspacing="0" cellpadding="0">
	<tr bgcolor="FF9966">
		<td height="29" align="left" valign="top" bgcolor="#FF9966" colspan="4">&nbsp;</td>
	</tr>
	<tr>
	<td bgcolor="#E5E5E5" align="center" width="91%" colspan="4">
	<span lang="en-us">&nbsp;</span><span lang="en-us" style="font-size: 8.5pt"><font face="Verdana" color="#006699"><b>Download Questionnaire3 Tables,KML File for GIS</b></font></span></td>
</tr>
<tr><td bgcolor="#E5E5E5" align="left" width="91%" colspan="4">&nbsp;</td></tr>
<tr><td width="91%" colspan="4" align="center"><font face="Verdana" style="font-size: 8.5pt" color="#000000">District&nbsp; <?php echo $data['district_name'];?></font></td></tr>
		<tr>
			<td width="106" height="27" align="center">
					<font face="Verdana" style="font-size: 8.5pt" color="#000000"><b>List of Tables</b></font></td>
			
			<!--<td width="133"><font style="font-size: 8.5pt" face="Verdana" color="#000000">Form Id</font></td>
			<td width="246"><font id="form_id">
		  	<select name="form_id" id="form_id" class="txt">
				<option value="0">==Select form_id==</option>
        	</select></font><span id="formLoader"></span></td>-->
		</tr>
		<tr>
			<td colspan="4">
			<table border="1" width="438" cellspacing="0" cellpadding="0" align="center">
			<tr align="center" bgcolor="#C5D8EB" height="25">
			<td width="53"><font face="Verdana" style="font-size: 8.5pt" color="#000000">Sr. No.</font></td>
			<td width="245"><font face="Verdana" style="font-size: 8.5pt" color="#000000">Table Name</font></td>
			<td width="118"><font face="Verdana" style="font-size: 8.5pt" color="#000000">Download in Excel</font></td>
			</tr>
			<tr align="center" height="20">
			<td width="53"><font face="Verdana" style="font-size: 8.5pt" color="#000000">1.</font></td>
			<td width="245"><font face="Verdana" style="font-size: 8.5pt" color="#000000">Main Table</font></td>
			<td width="118"><a href="q3_gis1.php?fl=tbl_dtls_q3_loc&distId=<?php echo $distId;?>"><font face="Verdana" style="font-size: 8.5pt">Download</font></a></td>
			</tr>
			<tr align="center" height="20">
			<td width="53"><font face="Verdana" style="font-size: 8.5pt" color="#000000">2.</font></td>
			<td width="245"><font face="Verdana" style="font-size: 8.5pt" color="#000000">Habitation Table</font></td>
			<td width="118"><a href="q3_gis1.php?fl=tbl_dtls_q3_habit&distId=<?php echo $distId;?>"><font face="Verdana" style="font-size: 8.5pt">Download</font></a></td>
			</tr>
			<tr align="center" height="20">
			<td width="53"><font face="Verdana" style="font-size: 8.5pt" color="#000000">3.</font></td>
			<td width="245"><font face="Verdana" style="font-size: 8.5pt" color="#000000">Last Table</font></td>
			<td width="118"><a href="q3_gis1.php?fl=tbl_dtls_q3_last&distId=<?php echo $distId;?>"><font face="Verdana" style="font-size: 8.5pt">Download</font></a></td>
			</tr>
			<tr align="center" height="20">
			<td width="53"><font face="Verdana" style="font-size: 8.5pt" color="#000000">4.</font></td>
			<td width="245"><font face="Verdana" style="font-size: 8.5pt" color="#000000">PSP Table</font></td>
			<td width="118"><a href="q3_gis1.php?fl=tbl_dtls_q3_psp&distId=<?php echo $distId;?>"><font face="Verdana" style="font-size: 8.5pt">Download</font></a></td>
			</tr>
			<tr align="center" height="20">
			<td width="53"><font face="Verdana" style="font-size: 8.5pt" color="#000000">5.</font></td>
			<td width="245"><font face="Verdana" style="font-size: 8.5pt" color="#000000">Ranking Table</font></td>
			<td width="118"><a href="q3_gis1.php?fl=tbl_dtls_q3_ranking&distId=<?php echo $distId;?>"><font face="Verdana" style="font-size: 8.5pt">Download</font></a></td>
			</tr>
			<tr align="center" height="20">
			<td width="53"><font face="Verdana" style="font-size: 8.5pt" color="#000000">6.</font></td>
			<td width="245"><font face="Verdana" style="font-size: 8.5pt" color="#000000">Reservoire2 Table</font></td>
			<td width="118"><a href="q3_gis1.php?fl=tbl_dtls_q3_reserv2&distId=<?php echo $distId;?>"><font face="Verdana" style="font-size: 8.5pt">Download</font></a></td>
			</tr>
			<tr align="center" height="20">
			<td width="53"><font face="Verdana" style="font-size: 8.5pt" color="#000000">7.</font></td>
			<td width="245"><font face="Verdana" style="font-size: 8.5pt" color="#000000">Reservoires Table</font></td>
			<td width="118"><a href="q3_gis1.php?fl=tbl_dtls_q3_reservoirs&distId=<?php echo $distId;?>"><font face="Verdana" style="font-size: 8.5pt">Download</font></a></td>
			</tr>
			<tr align="center" height="20">
			<td width="53"><font face="Verdana" style="font-size: 8.5pt" color="#000000">8.</font></td>
			<td width="245"><font face="Verdana" style="font-size: 8.5pt" color="#000000">Water Supply Infrastructure Table</font></td>
			<td width="118"><a href="q3_gis1.php?fl=tbl_dtls_q3_supply_infra_ground&distId=<?php echo $distId;?>"><font face="Verdana" style="font-size: 8.5pt">Download</font></a></td>
			</tr>
			<tr align="center" height="20">
			<td width="53"><font face="Verdana" style="font-size: 8.5pt" color="#000000">9.</font></td>
			<td width="245"><font face="Verdana" style="font-size: 8.5pt" color="#000000">Tanker Supply Table</font></td>
			<td width="118"><a href="q3_gis1.php?fl=tbl_dtls_q3_tanker_supply&distId=<?php echo $distId;?>"><font face="Verdana" style="font-size: 8.5pt">Download</font></a></td>
			</tr>
			<tr align="center" height="20">
			<td width="53"><font face="Verdana" style="font-size: 8.5pt" color="#000000">10.</font></td>
			<td width="245"><font face="Verdana" style="font-size: 8.5pt" color="#000000">Traditional Source Table</font></td>
			<td width="118"><a href="q3_gis1.php?fl=tbl_dtls_q3_traditional_src&distId=<?php echo $distId;?>"><font face="Verdana" style="font-size: 8.5pt">Download</font></a></td>
			</tr>
			<tr align="center" height="20">
			<td width="53"><font face="Verdana" style="font-size: 8.5pt" color="#000000">11.</font></td>
			<td width="245"><font face="Verdana" style="font-size: 8.5pt" color="#000000">Unlisted Habitation Table</font></td>
			<td width="118"><a href="q3_gis1.php?fl=tbl_dtls_q3_unhabit&distId=<?php echo $distId;?>"><font face="Verdana" style="font-size: 8.5pt">Download</font></a></td>
			</tr>
			<tr align="center" height="20">
			<td width="53"><font face="Verdana" style="font-size: 8.5pt" color="#000000">12.</font></td>
			<td width="245"><font face="Verdana" style="font-size: 8.5pt" color="#000000">Water Safe Table</font></td>
			<td width="118"><a href="q3_gis1.php?fl=tbl_dtls_q3_water_safe&distId=<?php echo $distId;?>"><font face="Verdana" style="font-size: 8.5pt">Download</font></a></td>
			</tr>
			<tr align="center" height="20">
			<td width="53"><font face="Verdana" style="font-size: 8.5pt" color="#000000">13.</font></td>
			<td width="245"><font face="Verdana" style="font-size: 8.5pt" color="#000000">Water Source Table</font></td>
			<td width="118"><a href="q3_gis1.php?fl=tbl_dtls_q3_water_source&distId=<?php echo $distId;?>"><font face="Verdana" style="font-size: 8.5pt">Download</font></a></td>
			</tr>
			<tr align="center" height="20">
			<td width="53"><font face="Verdana" style="font-size: 8.5pt" color="#000000">14.</font></td>
			<td width="245"><font face="Verdana" style="font-size: 8.5pt" color="#000000">Water Source Detail Table</font></td>
			<td width="118"><a href="q3_gis1.php?fl=tbl_dtls_q3_water_source_detail&distId=<?php echo $distId;?>"><font face="Verdana" style="font-size: 8.5pt">Download</font></a></td>
			</tr>
			<tr align="center" height="20">
			<td width="53"><font face="Verdana" style="font-size: 8.5pt" color="#000000">15.</font></td>
			<td width="245"><font face="Verdana" style="font-size: 8.5pt" color="#000000">Water Status Table</font></td>
			<td width="118"><a href="q3_gis1.php?fl=tbl_dtls_q3_water_status&distId=<?php echo $distId;?>"><font face="Verdana" style="font-size: 8.5pt">Download</font></a></td>
			</tr>
			</table>
			
			</td>
		</tr>
		<tr>
			<td colspan="4">&nbsp;</td>
		</tr>
		<tr>
			<td colspan="4" align="center"><font face="Verdana" style="font-size: 8.5pt" color="#000000"><b>Download KML files</b></font></td>
		</tr>
		<tr>
			<td colspan="4">
			<table border="1" width="438" cellspacing="0" cellpadding="0" align="center"> 
			<tr align="center" height="20">
			<td width="53"><font face="Verdana" style="font-size: 8.5pt" color="#000000">1.</font></td>
			<td width="245"><font face="Verdana" style="font-size: 8.5pt" color="#000000">KML Files</font></td>
			<?php
			$file = "upload_kmlfiles/".$data['district_name'].".zip";
 			if(file_exists($file))
			{
			?>
			<td width="118"><a href="q3_kml_file.php?distName=<?php echo $data['district_name'];?>"><font face="Verdana" style="font-size: 8.5pt">Download</font></a></td>
			<?php
			}
			else
			{
			?>
			<td width="118"><font face="Verdana" style="font-size: 8.5pt" color="#000000">KML file does not exist</font></td>
			<?php
			}
			?>
			</tr>
			</table>
			<table>
			<tr>
			<td colspan="4">&nbsp;</td>
			</tr>
			</table>
			<table border="1" width="438" cellspacing="0" cellpadding="0" align="center">
			
			<tr align="center" height="20">
			<td width="53"><font face="Verdana" style="font-size: 8.5pt" color="#000000">1.</font></td>
			<td width="245"><font face="Verdana" style="font-size: 8.5pt" color="#000000">Water Quality Report</font></td>
			<td width="118"><a href="water_quality.php?distId=<?php echo $distId;?>"><font face="Verdana" style="font-size: 8.5pt">Download</font></a></td>
			</tr>
			</table>
			</td>
		</tr>
		<tr>
			<td colspan="4">
			
			</td>
		</tr>
	</table>
</form>
</div>
</body>
</html>
